<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        1、Person1本质就是一个函数, 有prototype也有constructor属性指向自己
        2、Person1里面写了一个show方法的效果和Person2在prototype中加show函数的效果一样
     -->
    <script>
        class Person1 { 
            show () { 
                
            }
            constructor () {

            }
        }

        const p1 = new Person1()
        console.log(p1 instanceof Person1.constructor)
        console.log(p1 instanceof Person1)

        console.dir(Person1)

        function Person2 () { 
        
        }
        Person2.prototype.show = function () {}
        Person2.prototype.constructor = function () {}
        console.dir(Person2)
    </script>
</body>
</html>